home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / updsqled.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  6.0 KB  |  158 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'UpdSqlEd.pas' rev: 3.00
  6.  
  7. #ifndef UpdSqlEdHPP
  8. #define UpdSqlEdHPP
  9. #include <Menus.hpp>
  10. #include <Windows.hpp>
  11. #include <SysUtils.hpp>
  12. #include <Classes.hpp>
  13. #include <ComCtrls.hpp>
  14. #include <Controls.hpp>
  15. #include <StdCtrls.hpp>
  16. #include <ExtCtrls.hpp>
  17. #include <DBTables.hpp>
  18. #include <Db.hpp>
  19. #include <Forms.hpp>
  20. #include <SysInit.hpp>
  21. #include <System.hpp>
  22.  
  23. //-- user supplied -----------------------------------------------------------
  24.  
  25. namespace Updsqled
  26. {
  27. //-- type declarations -------------------------------------------------------
  28. typedef void __fastcall (__closure *TWaitMethod)(void);
  29.  
  30. class DELPHICLASS TUpdateSQLEditForm;
  31. class PASCALIMPLEMENTATION TUpdateSQLEditForm : public Forms::TForm 
  32. {
  33.     typedef Forms::TForm inherited;
  34.     
  35. __published:
  36.     Stdctrls::TButton* OkButton;
  37.     Stdctrls::TButton* CancelButton;
  38.     Stdctrls::TButton* HelpButton;
  39.     Stdctrls::TButton* GenerateButton;
  40.     Stdctrls::TButton* PrimaryKeyButton;
  41.     Stdctrls::TButton* DefaultButton;
  42.     Stdctrls::TComboBox* UpdateTableName;
  43.     Comctrls::TTabSheet* FieldsPage;
  44.     Comctrls::TTabSheet* SQLPage;
  45.     Comctrls::TPageControl* PageControl;
  46.     Stdctrls::TListBox* KeyFieldList;
  47.     Stdctrls::TListBox* UpdateFieldList;
  48.     Stdctrls::TGroupBox* GroupBox1;
  49.     Stdctrls::TLabel* Label1;
  50.     Stdctrls::TMemo* SQLMemo;
  51.     Dbtables::TTable* FTempTable;
  52.     Extctrls::TRadioGroup* StatementType;
  53.     Stdctrls::TCheckBox* QuoteFields;
  54.     Stdctrls::TButton* GetTableFieldsButton;
  55.     Menus::TPopupMenu* FieldListPopup;
  56.     Menus::TMenuItem* miSelectAll;
  57.     Menus::TMenuItem* miClearAll;
  58.     void __fastcall FormCreate(System::TObject* Sender);
  59.     void __fastcall HelpButtonClick(System::TObject* Sender);
  60.     void __fastcall StatementTypeClick(System::TObject* Sender);
  61.     void __fastcall OkButtonClick(System::TObject* Sender);
  62.     void __fastcall DefaultButtonClick(System::TObject* Sender);
  63.     void __fastcall GenerateButtonClick(System::TObject* Sender);
  64.     void __fastcall PrimaryKeyButtonClick(System::TObject* Sender);
  65.     void __fastcall PageControlChanging(System::TObject* Sender, bool &AllowChange);
  66.     void __fastcall FormDestroy(System::TObject* Sender);
  67.     void __fastcall GetTableFieldsButtonClick(System::TObject* Sender);
  68.     void __fastcall SettingsChanged(System::TObject* Sender);
  69.     void __fastcall FormCloseQuery(System::TObject* Sender, bool &CanClose);
  70.     void __fastcall UpdateTableNameChange(System::TObject* Sender);
  71.     void __fastcall UpdateTableNameClick(System::TObject* Sender);
  72.     void __fastcall SelectAllClick(System::TObject* Sender);
  73.     void __fastcall ClearAllClick(System::TObject* Sender);
  74.     void __fastcall SQLMemoKeyPress(System::TObject* Sender, char &Key);
  75.     
  76. private:
  77.     int StmtIndex;
  78.     Dbtables::TDBDataSet* DataSet;
  79.     Dbtables::TDatabase* Database;
  80.     bool DatabaseOpened;
  81.     Dbtables::TUpdateSQL* UpdateSQL;
  82.     bool FSettingsChanged;
  83.     bool FDatasetDefaults;
  84.     Classes::TStrings* SQLText[3];
  85.     System::AnsiString __fastcall GetTableRef(const System::AnsiString TabName, const System::AnsiString 
  86.         QuoteChar);
  87.     bool __fastcall DatabaseOpen(void);
  88.     bool __fastcall Edit(void);
  89.     void __fastcall GenWhereClause(const System::AnsiString TabAlias, const System::AnsiString QuoteChar
  90.         , Classes::TStrings* KeyFields, Classes::TStrings* SQL);
  91.     void __fastcall GenDeleteSQL(const System::AnsiString TableName, const System::AnsiString QuoteChar
  92.         , Classes::TStrings* KeyFields, Classes::TStrings* SQL);
  93.     void __fastcall GenInsertSQL(const System::AnsiString TableName, const System::AnsiString QuoteChar
  94.         , Classes::TStrings* UpdateFields, Classes::TStrings* SQL);
  95.     void __fastcall GenModifySQL(const System::AnsiString TableName, const System::AnsiString QuoteChar
  96.         , Classes::TStrings* KeyFields, Classes::TStrings* UpdateFields, Classes::TStrings* SQL);
  97.     void __fastcall GenerateSQL(void);
  98.     void __fastcall GetDataSetFieldNames(void);
  99.     void __fastcall GetTableFieldNames(void);
  100.     void __fastcall InitGenerateOptions(void);
  101.     void __fastcall InitUpdateTableNames(void);
  102.     void __fastcall SetButtonStates(void);
  103.     void __fastcall SelectPrimaryKeyFields(void);
  104.     void __fastcall SetDefaultSelections(void);
  105.     void __fastcall ShowWait(TWaitMethod WaitMethod);
  106.     Dbtables::TTable* __fastcall TempTable(void);
  107. public:
  108.     /* TCustomForm.Create */ __fastcall virtual TUpdateSQLEditForm(Classes::TComponent* AOwner) : Forms::
  109.         TForm(AOwner) { }
  110.     /* TCustomForm.CreateNew */ __fastcall TUpdateSQLEditForm(Classes::TComponent* AOwner, int Dummy) : 
  111.         Forms::TForm(AOwner, Dummy) { }
  112.     /* TCustomForm.Destroy */ __fastcall virtual ~TUpdateSQLEditForm(void) { }
  113.     
  114. public:
  115.     /* TWinControl.CreateParented */ __fastcall TUpdateSQLEditForm(HWND ParentWindow) : Forms::TForm(ParentWindow
  116.         ) { }
  117.     
  118. };
  119.  
  120. enum TSQLToken { stSymbol, stAlias, stNumber, stComma, stEQ, stOther, stLParen, stRParen, stEnd };
  121.  
  122. class DELPHICLASS TSQLParser;
  123. class PASCALIMPLEMENTATION TSQLParser : public System::TObject 
  124. {
  125.     typedef System::TObject inherited;
  126.     
  127. private:
  128.     System::AnsiString FText;
  129.     char *FSourcePtr;
  130.     char *FTokenPtr;
  131.     System::AnsiString FTokenString;
  132.     TSQLToken FToken;
  133.     bool FSymbolQuoted;
  134.     TSQLToken __fastcall NextToken(void);
  135.     bool __fastcall TokenSymbolIs(const System::AnsiString S);
  136.     void __fastcall Reset(void);
  137.     
  138. public:
  139.     __fastcall TSQLParser(const System::AnsiString Text);
  140.     void __fastcall GetSelectTableNames(Classes::TStrings* List);
  141.     void __fastcall GetUpdateTableName(System::AnsiString &TableName);
  142.     void __fastcall GetUpdateFields(Classes::TStrings* List);
  143.     void __fastcall GetWhereFields(Classes::TStrings* List);
  144. public:
  145.     /* TObject.Destroy */ __fastcall virtual ~TSQLParser(void) { }
  146.     
  147. };
  148.  
  149. //-- var, const, procedure ---------------------------------------------------
  150. extern PACKAGE bool __fastcall EditUpdateSQL(Dbtables::TUpdateSQL* AUpdateSQL);
  151.  
  152. }    /* namespace Updsqled */
  153. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  154. using namespace Updsqled;
  155. #endif
  156. //-- end unit ----------------------------------------------------------------
  157. #endif    // UpdSqlEd
  158.